﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WCFMINERP.Client
{
    public partial class FrmSetting : Form
    {
        public FrmSetting()
        {
            InitializeComponent();
        }

        private void simpleButtonOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(textEditUpSize.Text))
            {
                Properties.Settings.Default.Speed = Convert.ToInt32(textEditUpSize.Text);

            }
            else
            {
                Properties.Settings.Default.Speed = 100;
                textEditUpSize.Text = "100";
             }

            if (!string.IsNullOrEmpty(textEditWorkFolder.Text))
            {

                Properties.Settings.Default.WorkFolder = textEditWorkFolder.Text;
            }
            Properties.Settings.Default.Save();
        }

        private void simpleButtonSelectPath_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                textEditWorkFolder.Text = folderBrowserDialog1.SelectedPath;
            }
        }
    }
}
